<?php
header("content-type:text/html;charset=utf-8");

include_once "0.1conn.php"; //连接数据库

session_start();
$shop_id = $_SESSION['user']['shop_id'];
$query = "SELECT * FROM lack_record WHERE shop_id = '$shop_id'";

$arr = array();
if ($result = mysqli_query($conn, $query)) {
    //显示查询结果
    while ($row = mysqli_fetch_assoc($result)) {
        $good_id = $row['good_id'];
        $sid = $row['shop_id'];
        $row_detail = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM clothes WHERE good_id = '$good_id'"));
        $row_detail['lack_num'] = $row['lack_num'];
        $arr[] = $row_detail;
    }
    //释放结果集合
    mysqli_free_result($result);
}
echo json_encode($arr);
//关闭连接
mysqli_close($conn);

